//${magicEntity.description}
import 'java.util.Map' as Map;
import 'java.util.HashMap' as Map;
var map = new HashMap();
<#list pathParameterList as parameter>
    map.put("${parameter.dbColumn}",path.${parameter.parameterKey});
</#list>
<#list requestParameterList as parameter>
    map.put("${parameter.dbColumn}",${parameter.parameterKey});
</#list>
var execDb = db;
<#if datasourceKey??>
    executeDb = executeDb.${datasourceKey};
</#if>
var sql = """
delete from ${tableName}
<where>
    <#list parameterList as parameter>
        <#if parameter.parameterType=="String">
            <if test="map.${parameter.parameterKey} != null and map.${parameter.parameterKey} !=''">
                and ${parameter.dbColumn} = ${r"#{"}map.id${r"}"}
        <#else>
            <if test="map.${parameter.parameterKey} != null">
            </if>
        </#if>
    </#list>
</where>
"""
return executeDb.update(sql)